<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/10/11 21:24
 */

namespace module\ai\library\channel\interface;

use module\ai\library\channel\Completion;
use OpenAI\Responses\Chat\CreateResponse;
use OpenAI\Responses\StreamResponse;

interface ChatInterface
{
    /**
     * @param string $system
     * @return mixed
     */
    public function withSystem(string $system): ChatInterface;

    /**
     * @param string $prompt
     * @param string $response
     * @param mixed|null $extra
     * @return ChatInterface
     */
    public function withHistory(string $prompt, string $response, mixed $extra = null): ChatInterface;

    /**
     * @param string $prompt
     * @param array $options
     * @return CreateResponse
     */
    public function create(string $prompt, array $options = []): CreateResponse;

    /**
     * @param string $prompt
     * @param array $options
     * @return StreamResponse
     */
    public function createStreamed(string $prompt, array $options = []): StreamResponse;
}